package com.scm.biz.service._impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.scm.biz.bean.SysRole;
import com.scm.biz.dao.SysRoleDao;
import com.scm.biz.query.SysRoleQuery;
import com.scm.biz.service.SysRoleService;
@Service
public class SysRoleServiceImpl implements SysRoleService{
	@Autowired
	SysRoleDao sysRoleDao;
	@Override
	public List<SysRole> selectList(SysRoleQuery sysRoleQuery) {
		if(sysRoleQuery ==null){
			sysRoleQuery = new SysRoleQuery();
		}
		return sysRoleDao.selectList(sysRoleQuery);
	}
	@Override
	public SysRole selectById(Integer id) {
		return sysRoleDao.selectByPrimaryKey(id);
	}
	@Override
	public void deleteById(Integer id) {
		sysRoleDao.deleteByPrimaryKey(id);
	}
	@Override
	public SysRole selectByCode(String resourceCode) {
		// TODO Auto-generated method stub
		return sysRoleDao.selectByCode(resourceCode);
	}
	
	@Override
	public List<SysRole> selectListByUserId(int userId){
		return sysRoleDao.selectListByUserId(userId);	
	}
	
}
